﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Data;

namespace for7raid.vkPlayer
{
    public class TimeConverter :IValueConverter
    {

        #region Члены IValueConverter

        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            var ms = (double)value;
            var ts = TimeSpan.FromMilliseconds(ms);
            return string.Format("{0:00}:{1:00}",ts.Minutes,ts.Seconds);
        }

        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            throw new NotImplementedException();
        }

        #endregion
    }
}
